Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples to align with latest best practices #963

Merged
merged 1 commit into from
Jan 12, 2025

Conversation

markbackman
Copy link
Contributor

Please describe the changes in your PR. If it is addressing an issue, please reference that as well.

Main changes are:

  1. Replace await task.queue_frames([LLMMessagesFrame(messages)]) with await task.queue_frames([context_aggregator.user().get_context_frame()]).
  2. Add
@transport.event_handler("on_participant_left")
        async def on_participant_left(transport, participant, reason):
            await task.queue_frame(EndFrame())

to all 07 interrupted examples (and a select number of others where it was needed)
3. Update PipelineParams in 07 interrupted examples to match:

PipelineParams(
                allow_interruptions=True,
                enable_metrics=True,
                enable_usage_metrics=True,
                report_only_initial_ttfb=True,
            ),
  1. Add copyright headers
  2. Replace LLMAssistantResponseAggregator and LLMUserResponseAggregator with OpenAILLMContext

@aconchillo
Copy link
Contributor

LGTM

@markbackman markbackman merged commit 53bfdfd into main Jan 12, 2025
5 checks passed
@markbackman markbackman deleted the mb/cleanup-examples branch January 12, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants